package com.itheima.mapper;

import com.itheima.pojo.Clazz;
import com.itheima.pojo.ClazzQueryParam;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClazzMapper {
    List<Clazz> findAll(ClazzQueryParam  param);
    @Insert("insert into clazz(name,room,begin_date,end_date,master_id,subject) values(#{name},#{room},#{beginDate},#{endDate},#{masterId},#{subject})")
    void add(Clazz clazz);
    @Delete("delete from clazz where id=#{id}")
    void delete(Integer id);
    @Select(("select * from clazz where id = #{id}"))
    Clazz findById(Integer id);
    @Select("select * from clazz")
    List<Clazz> list();

    void update(Clazz clazz);
}
